Git Beyond the Clouds: The Secret Architecture of Collaboration part 4

Git Beyond the Clouds: How Code Travels, Collaborates & Secures Itself – Part 3

Git Beyond the Clouds: How Code Travels, Collaborates & Secures Itself – Part 4

By Kalyan Kalavena

This document provides a detailed briefing on the key concepts and practical applications of Git, drawing from three training sessions. The primary focus is on version control, collaboration, branching strategies, and conflict resolution within a distributed version control system environment, specifically using Bitbucket.

1. Introduction to Git and Version Control

Git is a third-generation distributed version control system (DVCS) that addresses the limitations of earlier systems. Unlike first-generation systems (e.g., SharePoint, which locked files) and second-generation centralized systems (e.g., SVN, which only stored working copies locally), Git maintains a complete remote repository in your local system. This means it stores the entire history of commits, enabling better branching and merging strategies. A key advantage of Git is that it "no need of internet connection for every commit," only requiring connectivity when pushing changes to the central repository.

Core Git Commands and Concepts (Recap from Session 2):

  • git init: Initializes a Git repository.
  • git status: Shows the status of files and folders in the repository.
  • git add <file_name>: Adds a file to the staging area.
  • git commit -m "message": Records changes to the local repository.
  • git push origin master: Pushes committed changes to the central repository.
  • .gitignore: Defines ignored files.
  • git config --global user.name & git config --global user.email: User identity settings.
  • git log: Shows commit history using SHA ID.

2. Setting Up a Collaborative Environment with Bitbucket

2.1 Cloud Infrastructure (Google Cloud Platform - GCP):

GCP is chosen for its generous free tier and compatibility. Bitbucket requires at least 2GB RAM; GCP offers up to 6GB RAM on free credits.

2.2 Creating a Virtual Machine (VM) for Bitbucket:

  • Use CentOS 8 for Git version 2.11+ support.
  • Reserve a static IP to avoid broken URLs after VM reboots.
  • Configure firewall rules (port 7990 for Bitbucket).

2.3 Connecting to the Linux Server:

SSH access using private/public key method:

ssh-keygen
ssh -i <pem_file> <user>@<IP>

2.4 Bitbucket Installation:

yum install git -y
wget <bitbucket_url>
chmod +x <installer_file>
./<installer_file>

Configure directories, access via http://<IP>:7990, and enable public sign-up for practice.

3. Git Collaboration and Branching Strategies

3.1 Basic Branching and Merging:

git branch
git checkout -b feature-1.1 master
git push origin feature-1.1
git checkout master
git merge feature-1.1

3.2 Conflict Resolution:

Merge conflict markers:

<<<<<<< HEAD
// your changes
=======
// incoming changes
>>>>>>> commitID

Resolve manually, then:

git add filename
git commit -m "Resolved merge conflicts"
git push origin branch_name

3.3 Branching Strategies:

Git Flow model with:

  • master: production-ready
  • development: staging for next release
  • feature, release, hotfix branches

Includes SIT/UAT environments and immediate hotfixes.

Disadvantage: Not ideal for microservices/Agile—too many long-lived branches.

3.4 Pull Requests (PRs):

  • Developer finishes a feature branch
  • Creates PR to merge into development
  • Team reviews, comments, approves
  • Bitbucket branch permissions restrict direct commits to protected branches

3.5 Merge vs Rebase (Preview):

  • Merge: Combine branches with full history
  • Rebase: Reapply commits on top of another branch—cleaner history, ideal when branches aren’t dependent

More detailed explanation will come in future sessions.

4. Continuous Learning and Resources

Key areas to learn:

  • Java/Python
  • Linux OS
  • Networking (IP, DNS)
  • Databases: MySQL, MongoDB
  • Docker, CI/CD

Stay updated share to the beginners it may helpful


Patent: Authored and Registered by Kalyan Kalavena

Comments